package com.kx.game.center.manager;

import com.kx.core.dawn.dbs.dao.DaoManager;
import com.kx.core.dawn.dbs.entity.GatewayEntity;

public class GatewayManager {

    public void update(GatewayEntity gatewayEntity, int count, String ip, String port, String timeMillis) {
        gatewayEntity.setCount(count);
        gatewayEntity.setIp(ip);
        gatewayEntity.setPort(port);
        gatewayEntity.setTime(timeMillis);
        DaoManager.gatewayDao.update(gatewayEntity);
    }

    public void insert(String gateId, int count, String ip, String port, String timeMillis) {
        GatewayEntity gatewayEntity = new GatewayEntity();
        gatewayEntity.setGateId(gateId);
        gatewayEntity.setCount(count);
        gatewayEntity.setIp(ip);
        gatewayEntity.setPort(port);
        gatewayEntity.setTime(timeMillis + "");
        DaoManager.gatewayDao.insert(gatewayEntity);
    }
}
